<?php
//include('../lib/log4php/Logger.php');
//Logger::configure('../log/logconfig.xml');
//

include '../controller/LoginImplement.php';
class LoginOperation {
    private $log;
    public function __construct(){
       $this->log = Logger::getLogger(__CLASS__); 
    }
    
    public function login($loginRequest){
        $printArray = new PrintArray();
        $this->log->info($printArray->printArrayMultilineStyle($loginRequest));
        $login = new LoginImplement();
        $response = $login->login($loginRequest);
        $this->log->info($printArray->printArrayMultilineStyle($response));
	return $response;
    }
    
    public function override($overrideRequest){
        
        $printArray = new PrintArray();
        $this->log->info($printArray->printArrayMultilineStyle($overrideRequest));
        
        $roleList = array();
        $roleList[] = array( 'overrideRole' => 'ROLE1');
        $roleList[] = array( 'overrideRole' => 'ROLE2');
        
        $dateTime = date("Y-m-d h:i:s A");
        $refId = rand(10,10000000);
        $response = array();
        $response['overrideResponseHeader'] = array( 'refId' => $refId, 'dateTime' => $dateTime,'responseCode'=>'0','responseDesc'=>'success');
        $response['overrideResponseDetail'] = array( 'refId' => $refId, 'dateTime' => $dateTime,'overrideRole'=>$roleList);
        
        return $response;
    }
}
?>
